<template>
  <div>
    <el-card>
      <el-tag
        v-for="route in cachedViews"
        :key="route.name"
        closable
        @click="">
        {{ route.name }}
      </el-tag>
    </el-card>
  </div>
</template>

<script>
import {mapState} from "vuex";

export default {
  name: 'TagView',
  data() {
    return {
      tags: [
        {name: '标签一', type: ''},
        {name: '标签二', type: 'success'},
        {name: '标签三', type: 'info'},
        {name: '标签四', type: 'warning'},
        {name: '标签五', type: 'danger'}
      ]
    };
  },
  computed: {
    ...mapState(['cachedViews']),
  }
}
</script>

<style scoped>
.el-tag {
  margin: 0 10px;
}
</style>